package com.weiz.designpatterns.simplefactory;

public class SampleFactory {
    public static Sample creator(int which) {
        //getClass 产生 Sample 一般可使用动态类装载装入类。
        if (which==1)
            return new SampleA();
        else if (which==2)
            return new SampleB();
        return null;
    }
}